import { ajax } from '../http.js';
import { ajaxSync } from '../httpSync.js';

const getDistrictUrl = '/district/find_list';
const getEasyPayDistrictUrl = '/easypay_dict/get_easypay_district';

const getDistrict = (data, success, fail) => { // 获取城市地址
  ajax({
    url: getDistrictUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const getDistrictSync = (data, success, fail) => { // 获取城市地址
  return ajaxSync({
    url: getDistrictUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const getEastPayDistrictSync = (data, success, fail) => {
  return ajaxSync({
    url: getEasyPayDistrictUrl,
    data: data,
    success: success,
    fail: fail
  });
};

export {
  getDistrict,
  getDistrictSync,
  getEastPayDistrictSync
}